import request from "@/utils/request.js"

const API = {
  SAVE: '/deal/voucher',
  DELETE: '/deal/voucher',
  UPDATE: '/deal/voucher',
  PAGE: '/deal/voucher/page',
  EXPORT: '/deal/voucher/export',
}

export const reqSave = (param) => request.post(API.SAVE, param)
export const reqDelete = (id) => request.delete(API.DELETE, {params: {id}})
export const reqUpdate = (param) => request.put(API.UPDATE, param)
export const reqPage = (pn, ps, storeId, clerkId, customerId, voucherId, startTime, endTime, type) => request.get(API.PAGE, {
  params: {pn, ps, storeId, clerkId, customerId, voucherId, startTime, endTime, type}
})
export const reqExport = () => request.get(API.EXPORT, {responseType: 'blob'})
